.class Lcom/waiqin365/base/print/p;
.super Landroid/content/BroadcastReceiver;


# instance fields
.field final synthetic a:Lcom/waiqin365/base/print/PrintSettingActivity;


# direct methods
.method constructor <init>(Lcom/waiqin365/base/print/PrintSettingActivity;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/base/print/p;->a:Lcom/waiqin365/base/print/PrintSettingActivity;

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 6

    const/4 v3, 0x0

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v1, "android.bluetooth.device.action.FOUND"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    const-string/jumbo v0, "android.bluetooth.device.extra.DEVICE"

    invoke-virtual {p2, v0}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Landroid/bluetooth/BluetoothDevice;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothDevice;->getBondState()I

    move-result v1

    const/16 v2, 0xc

    if-eq v1, v2, :cond_2

    move v2, v3

    move v4, v3

    :goto_0
    iget-object v1, p0, Lcom/waiqin365/base/print/p;->a:Lcom/waiqin365/base/print/PrintSettingActivity;

    invoke-static {v1}, Lcom/waiqin365/base/print/PrintSettingActivity;->b(Lcom/waiqin365/base/print/PrintSettingActivity;)Ljava/util/ArrayList;

    move-result-object v1

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-ge v2, v1, :cond_1

    iget-object v1, p0, Lcom/waiqin365/base/print/p;->a:Lcom/waiqin365/base/print/PrintSettingActivity;

    invoke-static {v1}, Lcom/waiqin365/base/print/PrintSettingActivity;->b(Lcom/waiqin365/base/print/PrintSettingActivity;)Ljava/util/ArrayList;

    move-result-object v1

    invoke-virtual {v1, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/waiqin365/base/print/a;

    iget-object v1, v1, Lcom/waiqin365/base/print/a;->b:Ljava/lang/String;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothDevice;->getAddress()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v1, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    const/4 v4, 0x1

    :cond_0
    add-int/lit8 v1, v2, 0x1

    move v2, v1

    goto :goto_0

    :cond_1
    if-nez v4, :cond_2

    new-instance v1, Lcom/waiqin365/base/print/a;

    invoke-direct {v1}, Lcom/waiqin365/base/print/a;-><init>()V

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothDevice;->getName()Ljava/lang/String;

    move-result-object v2

    iput-object v2, v1, Lcom/waiqin365/base/print/a;->a:Ljava/lang/String;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothDevice;->getAddress()Ljava/lang/String;

    move-result-object v2

    iput-object v2, v1, Lcom/waiqin365/base/print/a;->b:Ljava/lang/String;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothDevice;->getBondState()I

    move-result v0

    iput v0, v1, Lcom/waiqin365/base/print/a;->c:I

    iput v3, v1, Lcom/waiqin365/base/print/a;->d:I

    iget-object v0, p0, Lcom/waiqin365/base/print/p;->a:Lcom/waiqin365/base/print/PrintSettingActivity;

    invoke-virtual {v0, v1}, Lcom/waiqin365/base/print/PrintSettingActivity;->a(Lcom/waiqin365/base/print/a;)V

    :cond_2
    :goto_1
    return-void

    :cond_3
    const-string/jumbo v1, "android.bluetooth.adapter.action.DISCOVERY_FINISHED"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/waiqin365/base/print/p;->a:Lcom/waiqin365/base/print/PrintSettingActivity;

    invoke-static {v0}, Lcom/waiqin365/base/print/PrintSettingActivity;->a(Lcom/waiqin365/base/print/PrintSettingActivity;)Landroid/widget/ImageView;

    move-result-object v0

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setVisibility(I)V

    goto :goto_1
.end method
